<template>
	<view class="header-bg-image header-bg">
		<view style="height: 50rpx;"></view>
		<view class="padding-30">
			<view class="margin-30-0 flex-around" @click="$tools.navigateBack()">
				<u-icon name="arrow-left" color="#333333" size="20"></u-icon>
				<view class="fontSize-18 color-000 flex1 text-center">核销记录</view>
				<view style="width: 40rpx;"></view>
			</view>

			<!-- 空数据 -->
			<view v-if="course_log.length==0">
				<empty-view></empty-view>
			</view>

			<!-- 列表 -->
			<view class="bg-fff padding-30 border-radius20">
				<u-steps :current="1" direction="column" activeColor="#947065" inactiveColor="947065">
					<u-steps-item :title="item.title" :desc="item.date" v-for="(item,index) in course_log" :key="index">
					</u-steps-item>
				</u-steps>
			</view>
		</view>
	</view>
</template>

<script>
	import emptyView from "@/components/empty/empty.vue"
	export default {
		components: {
			emptyView
		},
		data() {
			return {
				id:'',
				course_log:[]
			}
		},
		onLoad(e) {
			console.log(e)
			if(e.id){
				this.id = e.id
				this.getCourseDetail(this.id)
			}
		},
		methods:{
			// 获取详情信息
			async getCourseDetail(id){
				let res = await this.$http.post(this.$api.course_detail,{id:this.id},{token:true})
				if(res.code == 1){
					this.course_log = res.data.course_log.map(item=>{
						return{
							title:item.store_title + ' ' + item.course_count,
							date:item.date
						}
					})
				}
			}
		}
	}
</script>

<style lang="scss" scoped>

</style>